<?php

declare(strict_types=1);

namespace app\admin\filter\auth;

use sheep\filter\BaseFilter;
use think\facade\Request;
use think\db\Query;

/**
 * 管理员
 */
class AdminFilter extends BaseFilter
{
    protected $keywordFields = ['id', 'account', 'nickname', 'mobile', 'email'];


    /**
     * 角色搜索
     *
     * @param Query $query
     * @param string|array $data   查询数据
     * @return Query
     */
    public function roleId($query, $data)
    {
        $role_id = $this->getValue($data);
        return $query->where('role_id', $role_id);
    }
}
